/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aptech.data;

import aptech.entities.ScheduleActivity;
import java.util.List;

/**
 *
 * @author home
 */
public class ScheduleActivityBO extends ManagerBase<ScheduleActivity>{

    public ScheduleActivityBO() throws Exception{
        
    }

    public List<ScheduleActivity> getScheduleActivityComingSoon() throws Exception{
        beginTransaction();
        List<ScheduleActivity> list = getCurrentSession().createQuery("from ScheduleActivity where CONVERT(datetime,StartDateSchedule,103) between getdate() and getdate()+3 order by StartDateSchedule asc").list();
        commitAndClose();
        return list;
    }

    public List<ScheduleActivity> getScheduleActivityOnGoing() throws Exception{
        beginTransaction();
        List<ScheduleActivity> list = getCurrentSession().createQuery("from ScheduleActivity where CONVERT(varchar,StartDateSchedule,103) = CONVERT(varchar,getdate(),103) order by StartDateSchedule asc").list();
        commitAndClose();
        return list;
    }
}
